import { IsNotEmpty, IsOptional, IsString, Length } from "class-validator";
import { ApiProperty } from "@nestjs/swagger";

export class UpdateRoleDto {
    @ApiProperty({ description: "角色名称" })
    @IsString({ message: "remark 类型错误, 正确类型 string" })
    @Length(2, 20, { message: "name 字符长度在 2~20" })
    name?: string;
    
    @ApiProperty({ description: "角色备注", required: false })
    @IsString({ message: "remark 类型错误, 正确类型 string" })
    @Length(0, 100, { message: "name 字符长度在 0~100" })
    @IsOptional()
    remark?: string;
}
